﻿using DevExpress.ExpressApp.Utils;

namespace EasyXaf.RememberMe.Sample.Blazor.Server.Security;

public class LogonCookieSettingsStorage : SettingsStorage
{
    private readonly IHttpContextAccessor _httpContextAccessor;

    public LogonCookieSettingsStorage(IHttpContextAccessor httpContextAccessor)
    {
        _httpContextAccessor = httpContextAccessor;
    }

    public override string LoadOption(string optionPath, string optionName)
    {
        return _httpContextAccessor.HttpContext.Request.Cookies[optionName];
    }

    public override void SaveOption(string optionPath, string optionName, string optionValue)
    {
    }
}
